// pages/gps/gps.js
var app = getApp()
Page({
  data: {
  
  },
  onLoad: function (options) {
    wx.getLocation({
      type: 'gcj02', //返回可以用于wx.openLocation的经纬度
      success: function (res) {
        var latitude = res.latitude
        var longitude = res.longitude
        wx.chooseLocation({
          success: function (res) {
            var pages = getCurrentPages();
            var currPage = pages[pages.length - 1];   
            var prevPage = pages[pages.length - 2];
            prevPage.setData({
              gps: res.name
            }) 
          wx.navigateBack()
          }

        })
      }
    }) 
  },
  onReady: function () {
  
  }
})